package cn.edu.tju.elm.model.entity;

import cn.edu.tju.core.model.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import java.math.BigDecimal;

@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Where(clause = "is_deleted=false")
@DynamicUpdate
public class Food extends BaseEntity {

    @Column(nullable = false)
    private String foodName;
    private String foodExplain;
    @Column(columnDefinition = "TEXT")
    private String foodImg;
    @Column(precision = 10, scale = 2, nullable = false)
    private BigDecimal foodPrice;

    @ManyToOne
    @JoinColumn(name = "business_id", nullable = false)
    private Business business;

    private String remarks;

}
